package com.six.controller;

import com.six.pojo.BillDetail;
import com.six.pojo.BillManage;
import com.six.pojo.ReceiptAdvise;
import com.six.pojo.dto.BillDetailDto;
import com.six.result.Result;
import com.six.result.ResultUtils;
import com.six.service.BillDetailService;
import com.six.service.ReceiptAdviseService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "收货通知接口文档")
@RestController
@RequestMapping("/receiptAdvise")
@Slf4j
@CrossOrigin
public class ReceiptAdviseController {

    @Autowired
    private ReceiptAdviseService adviseService;

    @PostMapping("/list")
    public Result findList(){
        return null;
    }

    @PostMapping("/add")
    public Result add(){
        //TODO 先添加收获通知单，再添加收货通知详细信息
        return null;
    }

    @PutMapping("/update")
    public Result update(@RequestBody ReceiptAdvise receiptAdvise){
        adviseService.updateById(receiptAdvise);
        return ResultUtils.buildSuccess();
    }

    @DeleteMapping("/delete/{id}")
    public Result deleteById(@PathVariable Long id){
        // TODO 删除收货通知单时要同时删除收货通知单详细信息
        return ResultUtils.buildSuccess();
    }

}
